package com.cheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheng.common.exception.CommonException;
import com.cheng.common.utils.StringUtil;
import com.cheng.data.entity.AcptTypeInfEntity;
import com.cheng.data.mapper.AcptTypeInfMapper;
import com.cheng.service.AcptTypeInfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ChengJW
 * @date: 2021/11/7 23:33
 * @version: 1.0
 * @description: 受理状态 acpt_type_info 表操作
 */
@Service
public class AcptTypeInfServiceImpl implements AcptTypeInfService {

    private final static Logger log = LoggerFactory.getLogger(AcptTypeInfServiceImpl.class);

    @Autowired
    private AcptTypeInfMapper acptTypeInfMapper;

    /**
     * @author: ChengJW
     * @params: [entity]
     * @return: com.cheng.data.entity.AcptTypeInfEntity
     * @date: 2021/11/7
     * @description: 查询 acpt_type_inf 信息
     */
    @Override
    public List<AcptTypeInfEntity> queryAcptTypeInf(AcptTypeInfEntity entity) throws CommonException {

        if (null == entity){
            log.error("AcptTypeInfEntity is null");
            throw new CommonException("CJW202111010027","AcptTypeInfServiceImpl","queryAcptTypeInf");
        }
        QueryWrapper<AcptTypeInfEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtil.isNotNull(entity.getAfTypeCode()),"af_type_code",entity.getAfTypeCode());
        return acptTypeInfMapper.selectList(wrapper);
    }
}
